package models

import "time"

type Relation struct {
	ID        int64     `gorm:"primaryKey;autoIncrement;comment:主键"`
	UserID    int64     `gorm:"not null;default:0;index:fk_user_relation;comment:用户id"`
	ToUserID  int64     `gorm:"not null;default:0;index:fk_user_relation_to;comment:关注目标的用户id"`
	CreatedAt time.Time `gorm:"comment:创建时间"`
	UpdatedAt time.Time `gorm:"autoUpdateTime;comment:更新时间"`
	DeletedAt uint64    `gorm:"not null;default:0;comment:删除时间"`
	UniqueKey string    `gorm:"uniqueIndex:uk_relation;type:varchar(255);column:unique_key;default:''"`
}

func (Relation) TableName() string {
	return "relation"
}
